{include file="public/_meta" /}
<style>
    .form-radio-input{
        margin-top: 0;
    }
    .modal-content{
        width: 800px;
    }
</style>
<body>
<div class="wrapper">

    {include file="public/_header" /}

    <!-- Sidebar -->
    {include file="public/_menu" /}
    <!-- End Sidebar -->

    <div class="main-panel">

        <div class="content">

            <div class="page-inner">
            {include file="public/_page_header" /}


                <div class="row">
                    <div class="form-group">
                        <label class="form-label">广告账户接入</label>
                        <hr>
                        <div class="row">
                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/1.jpg" alt="title" title="百度官方" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('1')">
                                    </figure>
                                </label>
                            </div>
                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
<!--                                    <figure class="imagecheck-figure">-->
<!--                                        <a target="_blank" href="https://developers.e.qq.com/oauth/authorize?client_id={$appid}&redirect_uri={$domain}&state=tengxun_{$user_info.id}">-->
<!--                                        <img src="__STATIC__/manage/assets/img/2.jpg" alt="title" class="imagecheck-image" data-toggle="modal">-->
<!--                                        </a>-->
<!--                                    </figure>-->
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/2.jpg" alt="title" title="腾讯官方" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('2')">
                                    </figure>
                                </label>
                            </div>
                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <!--<figure class="imagecheck-figure">
                                        <a target="_blank" href="https://open.oceanengine.com/audit/oauth.html?app_id=1713472971279405&state=juliang_{$user_info.id}&scope=%5B10000000%2C130%2C4%2C5%2C8%2C9%2C2%2C14%2C112%2C110%2C120%2C122%5D&material_auth=1&redirect_uri=http%3A%2F%2Fad.91duoxin.com&rid=hzgi6y6mhkd">
                                        <img src="__STATIC__/manage/assets/img/3.jpg" alt="title" class="imagecheck-image" data-toggle="modal">
                                        </a>
                                    </figure>-->
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/3.jpg" alt="title" title="巨量官方" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('3')">
                                    </figure>
                                </label>
                            </div>
                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/6.png" alt="title" width="360" height="160" title="API-百度" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('6')">
                                    </figure>
                                </label>
                            </div>

                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/5.png" alt="title" width="360" height="160" title="API-腾讯" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('5')">
                                    </figure>
                                </label>
                            </div>

                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/4.png" alt="title" width="360" height="160" title="API-巨量" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('4')">
                                    </figure>
                                </label>
                            </div>
                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/7.png" alt="title" width="360" height="160" title="API-其他" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('7')">
                                    </figure>
                                </label>
                            </div>

                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/8.jpg" alt="title" width="360" height="160" title="UC浏览器" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('8')">
                                    </figure>
                                </label>
                            </div>

                            <div class="col-12 col-sm-4">
                                <label class="imagecheck mb-4">
                                    <figure class="imagecheck-figure">
                                        <img src="__STATIC__/manage/assets/img/9.jpg" alt="title" width="360" height="160" title="快手" class="imagecheck-image" data-toggle="modal" data-target="#addRowModal1" onClick="add_item('9')">
                                    </figure>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Modal -->
                <div class="modal fade" id="addRowModal1" tabindex="-1" role="dialog" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header no-bd">
                                <h5 class="modal-title">
                                    <span class="fw-mediumbold">添加</span>

                                </h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                <form id="form-modal1">
                                    <div class="row">

                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_name" class="col-md-3 col-form-label"><font style="vertical-align: inherit;color: red">账户名称</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="acc_name" name="acc_name" placeholder="账户名称">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_desc" class="col-md-3 col-form-label">账户简称<br>
                                                (商户系统显示)<br>(外链验证码短信签名)</label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="acc_desc" name="acc_desc" placeholder="账户简称(商户系统投放主体显示)">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="adv_id" class="col-md-3 col-form-label"><font style="vertical-align: inherit;color: red">账户ID</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="adv_id" name="adv_id" placeholder="账户ID">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_password" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">账户密码</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="acc_password" name="acc_password" placeholder="账户密码">
                                            </div>
                                        </div>
                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_password" class="col-md-3 col-form-label"><font style="vertical-align: inherit;color: red">返点</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="clue_rate" name="clue_rate" placeholder="返点百分比例如:10%填10">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_password" class="col-md-3 col-form-label"><font style="vertical-align: inherit;color: red">渠道别称</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="show_channel" name="show_channel" placeholder="商户端显示的渠道名称">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="acc_password" class="col-md-3 col-form-label"><font style="vertical-align: inherit;color: red">默认进线单价<br>(只在按A结算时设置)</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="clue_cost" name="clue_cost" placeholder="默认进线单价(只在按A结算时设置)">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="macc_id" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">管家账户ID</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="macc_id" name="macc_id" placeholder="管家账户ID，如果为普通用户填写账户ID即可">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="api_token" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">ApiToken</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="api_token" name="api_token" placeholder="ApiToken">
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="ocpc_token" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">转化Token</font></label>
                                            <div class="col-md-8 p-0">
                                                <input type="text" class="form-control input-full" id="ocpc_token" name="ocpc_token" placeholder="转化Token">
                                            </div>
                                        </div>


                                        <div class="form-group form-inline col-md-12">
                                            <label for="ocpc_token" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">选择优化师</font></label>
                                            <div class="col-md-8 p-0">
                                                <select class="form-control input-full" name="bind_youhua" id="bind_youhua">
                                                    <option value="0">--请选择--</option>
                                                    {volist name="youhua" id="vo"}
                                                    <option value="{$vo.uid}">【{$vo.realname}】【账号{$vo.phone}】</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label class="col-md-3 col-form-label">进线是否撞库排重</label>
                                            <label class="form-radio-label">
                                                <input class="form-radio-input" type="radio" name="is_check_repeat" value="1" checked="">
                                                <span class="form-radio-sign">&nbsp;&nbsp;是</span>
                                            </label>
                                            <label class="form-radio-label ml-3">
                                                <input class="form-radio-input" type="radio" name="is_check_repeat" value="2">
                                                <span class="form-radio-sign">&nbsp;&nbsp;否</span>
                                            </label>
                                        </div>



                                        <div class="form-group form-inline col-md-12">
                                            <label for="status" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">状态</font></label>
                                            <label class="form-radio-label">
                                                <input class="form-radio-input" type="radio" name="status" id="status" value="1" checked="">
                                                <span class="form-radio-sign">启用</span>
                                            </label>
                                            <label class="form-radio-label ml-3">
                                                <input class="form-radio-input" type="radio" name="status"0.
                                                         value="2">
                                                <span class="form-radio-sign">禁用</span>
                                            </label>
                                        </div>

                                        <div class="form-group form-inline col-md-12">
                                            <label for="remark" class="col-md-3 col-form-label"><font style="vertical-align: inherit;">备注</font></label>
                                            <div class="col-md-8 p-0">
                                                <textarea id="remark" name="remark" class="form-control input-full" style="height: 200px!important"></textarea>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="modal-footer no-bd">
                                        <input type="hidden" name="channel" value="1">
                                        <button type="submit" id="addRowButton" class="btn btn-primary">保存</button>
                                        <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                                    </div>
                                </form>
                            </div>

                        </div>
                    </div>
                </div>

            </div>
        </div>

        {include file="public/_footer" /}


    </div>

    <!-- Custom template -->
<!--    {include file="public/_setting" /}-->
    <!-- End Custom template -->

</div>

{include file="public/_js" /}

</body>

<script type="text/javascript">

    var SCOPE = {
        'add_url':"{:url('account/add')}",
        'href_url':"{:url('account/index')}",
    };

    $(function(){
        var commitStatus = false;
        /*表单验证*/
        $("#form-modal1").validate({
            rules:{
                name:{
                    required:true,
                    minlength:2,
                    maxlength:11
                }

            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                var url = SCOPE.add_url;
                if(commitStatus==true){
                    return false;
                }
                /*表单提交*/
                $(form).ajaxSubmit({
                    type: 'post',
                    url: url,
                    success: function(data){
                        if(data.code == 1001){
                            commitStatus==true
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                window.location.href = SCOPE.href_url;
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:2000});
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg(errorThrown,{icon:2,time:2000});
                    }
                });

            }
        });

    });

    function add_item(id) {
        document.getElementById('form-modal1').reset();
        $("[name=channel]").val(id);
    }
</script>
</html>